//
//  AFNetworkTool.h
//  test
//
//  Created by 朱圳 on 2018/1/9.
//  Copyright © 2018年 朱圳. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "AFNetworking.h"
typedef void (^CallBack)(id json);
@interface AFNetworkTool : NSObject

//单例，每次只允许一次网络请求
+(AFNetworkTool *)shareManager;

- (void)getJSONWithUrl:(NSString * )httpUrl parame:(id)parameters  successData:(void(^)(id json))successData failure:(void (^)(NSError *error))failure;

- (void)postJSONWithUrl : (NSString *)url parmas : (id)parameters successData:(CallBack)successData failure:(void (^)(NSError *error))failure;

/**
 单张图片上传
 
 @param url 上传地址
 @param params 请求参数
 @param data 图片的data
 @param progress 进度
 @param successHandle 成功回调函数
 @param failureHandel 失败回调函数
 */
- (void)upLoadSinglePictureWithUrl:(NSString *_Nullable)url
                        parameters:(id _Nullable)params
                          fileData:(NSData * _Nullable)data
                          progerss:(void (^ _Nullable)(NSProgress * _Nullable progress))progress
                           success: (void(^ _Nullable)(id _Nullable json))successHandle
                           failure:(void (^ _Nullable)(NSError * _Nullable error))failureHandel;



@end
